<script>
    layui.config({
        base: '/static/customAdmin/'
    }).extend({
        index: 'lib/index'
    }).use(['index', 'form', 'admin'], function () {
        const admin = layui.admin , form = layui.form;
        form.on('submit(perm_submit)', async (data) => {
            await admin.patch(`/resource/update/` + @{{ .m.Id }}, data.field);
        })
    });
</script>